home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / dir.str < prev    next >
Text File  |  1991-04-12  |  3KB  |  86 lines

  1. Article 2322 of comp.sys.handhelds:
  2. Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!samsung!zaphod.mps.ohio-state.edu!ub!acsu.buffalo.edu
  3. From: cloos@acsu.buffalo.edu (James H. Cloos)
  4. Newsgroups: comp.sys.handhelds
  5. Subject: Directory structure unearthed
  6. Message-ID: <46136@eerie.acsu.Buffalo.EDU>
  7. Date: 14 Nov 90 03:45:20 GMT
  8. Sender: news@acsu.Buffalo.EDU
  9. Distribution: comp
  10. Organization: State University of New York @ Buffalo
  11. Lines: 70
  12. Nntp-Posting-Host: lictor.acsu.buffalo.edu
  13.  
  14. Hello all.  I've finally determined precisely *how* sub-dir's are
  15. stored in the 48sx and 28s's.  Below, I will use the code _DIR for the
  16. header.  In the 48sx, the value of this is <#02A96h>; on the 28s, it
  17. is <#02AB8h>(from Eric Toonen's obj.doc; don't blame me if its incorrect).
  18. (I do take responsibility for the 48sx value, though).
  19.  
  20. The format is:
  21.  
  22. _DIR <#7ffh> (link_to_1st_object) (end_link) (nth_object) (link_to_nth_object)
  23. (n-1th_object) (link_to_n-1th_object) ... (1st_object)
  24.  
  25. 1st object is the one that is on the left-most menu key == the last
  26. object STO'ed, assuming ORDER hasn't been used.
  27.  
  28. All links are 5 nybbles long.
  29.  
  30. A link_to_ith_object field is also the length of the ith_object, in
  31. nybbles.
  32.  
  33. An object has the form:
  34. (len_of_name) (the_name) (len_of_name) (data_STO'ed_in_name)
  35.  
  36. The (end_link) field is <#00000h>.
  37.  
  38. Notice that the object are stored in reverse order, which means that
  39. when searching the directory tree, the hp sees a dir via the _DIR
  40. header, then uses the pointers to find each of the id's w/in that dir
  41. by 1st jumping to the "1st" one, which is at the end of the mem
  42. structure; it then sequentially looks at the pointer just before the
  43. "current" name and jumps back that many nybbles to find the "next" id.
  44. When a pointer of 0 is found, it knows that it is at the end of the
  45. directory. 
  46.  
  47. 2 Examples:
  48.  
  49. (remove the spaces and then ASC\-> these...)
  50.  
  51. 1)    DIR END
  52. is:    "69A20 FF7 00000 B6E5" == _DIR,7FF,00000,kcrc
  53.  
  54. 2)    DIR A SIN B COS END
  55. is:    "69A20 FF7 02000 00000 10 24 10 29E20 200 250 11000
  56.      10 41 10 29E20 200 150 1D89"
  57. which is:  _DIR,7ff,lnk_to_A,1_char_id,'B',1_char_name,
  58.         RomPtr,002,052,lnk_to_B,1_char_name,
  59.         'A',1_char_name,RomPtr,002,051,kcrc
  60.  
  61. (A RomPtr = ROM pointer = XLIB, so we see that SIN is library 2, cmd 52h.)
  62.  
  63. --
  64. I hope that this is understandable.  I'm currently at work putting
  65. together a rpl compiler, and have been concentrating just now on
  66. getting the bison grammer together.  I still have to figure out how to
  67. do a library, backup object, & unit object.  (At least now that it can
  68. do a directory, usrlib can be used to convert that into a library.)
  69. Anyway, given my primary project, I've not a lot of time to get this
  70. posting done properly.  Perhaps someone who understands what I'm
  71. saying can take the time to explain it for any who don't.  Oh, yes,
  72. the "kcrc" means kermit crc, which as I pointed out earlier is the
  73. algorithm for the BYTES crc; it is the one used for kermit transfers
  74. when checksum type is set to 3.  I included it above only so that the
  75. strings could be put thru ASC\->, these are not there in memory.
  76.  
  77. -JimC
  78. --
  79. James H. Cloos, Jr.        Phone:  +1 716 673-1250
  80. cloos@ACSU.Buffalo.EDU        Snail:  PersonalZipCode:  14048-0772, USA
  81. cloos@ub.UUCP            Quote:  <below:  ;^)>
  82.  
  83. THIS INFORMATION COMES WITHOUT ANY FORM OF WARRENTY, NOT EVEN IMPLIED ONES.
  84.  
  85.  
  86.